import UIKit

/**
    B站：https://www.bilibili.com/video/BV144411C7Gg?p=28

    第28课
        1. Any 类型
        2. AnyObject 类型
 */


struct Person {
    var name = ""
}


class Student {
    var name = ""
}

let a: Any = 1
print("a type=",type(of: a))

let b: Any = false
print("b type=",type(of: b))

let c: Any = "hello world"
print("c type=",type(of: c))

let d: Any = Person() // struct
print("d type=",type(of: d))

let e: Any = Student() // class
print("e type=",type(of: e))

// --------- why --------
let f: AnyObject = Person() as AnyObject // struct
print("f type=",type(of: f), f)

let g: AnyObject = Student()  // class
print("g type=",type(of: g))

// --------- why --------
let h: AnyClass = Student.self  // class
print("h type=",type(of: h), h)

